package c_api

import (
	//"fmt"
	"gintest/models"
	"gintest/until"
	"github.com/gin-gonic/gin"
	/*"strconv"
	"strings"
	"time"*/
)
func User_getuserinfo(c *gin.Context){
	token:=c.Keys["token"].(until.Token)
	user:=models.GetUserById(token.Id)
	if user.Id!=0{
		until.Success(c,gin.H{"id":user.Id,"username":user.UserName,"nickname":user.NickName,"phone":user.Phone,"email":user.Email,"avatar":user.Avatar,"sex":user.Sex})
	}else{
		until.Success(c,nil)
	}
	
}